package com.obas.model.type;

import com.ease.common.enums.EnumUtil;
import com.ease.common.enums.TextualEnum;

/**
 * 
 * @author nathanleewei
 * 
 */
public enum BaseHeadAttributeType implements TextualEnum, AttributeColumnType {

	FLOWSEQUENCE("报文序列号", "FLOWSEQUENCE", "NUMBER", 0, 1), //
	EXPORTTIME("发送日志的时间", "EXPORTTIME", "DATE", 0, 2), //
	DOMAINIP("数据采集设备的IP", "DOMAINIP", "VARCHAR2", 255, 3), //
	IPVERSION("IP版本号", "IPVERSION", "NUMBER", 0, 4), //
	USERIP("用户IP", "USERIP", "VARCHAR2", 255, 5), //
	USERPORT("源端口", "USERPORT", "NUMBER", 0, 6), //
	USERBEGINPORT("源端口块的开始端口", "USERBEGINPORT", "NUMBER", 0, 7), //
	USERENDPORT("源端口块的结束端口", "USERENDPORT", "NUMBER", 0, 8), //
	SERVERIP("服务器IP", "SERVERIP", "VARCHAR2", 255, 9), //
	SERVERPORT("目的端口", "SERVERPORT", "VARCHAR2", 255, 10), //
	SERVERID("业务ID", "SERVERID", "NUMBER", 0, 11), //
	APPID("应用ID", "APPID", "NUMBER", 0, 12), //
	PROTOCOLTYPE("传输协议", "PROTOCOLTYPE", "NUMBER", 0, 13), //
	STARTTIME("本段应用开始时间", "STARTTIME", "DATE", 0, 14), //
	ENDTIME("本段应用结束时间", "ENDTIME", "DATE", 0, 15);//

	private String text;
	//
	// private String code;

	private String columnName;

	private String dataType;

	private int length;

	private int ordinal;

	private BaseHeadAttributeType(String text, String columnName, String dataType, int length, int ordinal) {
		this.columnName = columnName;
		this.dataType = dataType;
		this.length = length;
		this.ordinal = ordinal;
		this.text = text;
	}

	public static BaseHeadAttributeType get(String name) {
		return EnumUtil.get(BaseHeadAttributeType.class, name);
	}

	public String getText() {
		return text;
	}

	public String getName() {
		return name();
	}

	/**
	 * @return the columnName
	 */
	public String getColumnName() {
		return columnName;
	}

	/**
	 * @return the dataType
	 */
	public String getDataType() {
		return dataType;
	}

	/**
	 * @return the length
	 */
	public int getLength() {
		return length;
	}

	/**
	 * @return the ordinal
	 */
	public int getOrdinal() {
		return ordinal;
	}

}
